﻿@using NetCoreCMS.Models;
@{
    ViewBag.Title = "管理首页";
    Sysconfig siteConfig = ViewData["config"] as Sysconfig;
}
@section Scripts{
    <script src="~/signalr/dist/browser/signalr.min.js"></script>
    <script>
        $(function () {
            $("body").addClass("mainbody");
        });
        var connection = new signalR.HubConnectionBuilder().withUrl("/NoticeHub").build();
        connection.on("OnMsg", function (date, message,ip) {
            document.getElementById("signalUserName").innerText="最新登录会员："+message;
            document.getElementById("signalTime").innerText="登录时间："+date;
            document.getElementById("signalIp").innerText="登录IP："+ip;
        });
        connection.start().then(function () {
            //btnSend.disabled = false;
        }).catch(function (err) {
            alert(err);
        });
    /*
        btnSend.onclick = function () {
            connection.invoke("SendMessage", txtMsg.value)
            .then(function () {
                txtMsg.value = "";
                txtMsg.focus();
            })
           .catch(function (err) {
                alert(err);
            });
        };*/
    </script>
}

<!--导航栏-->
<div class="location">
    <a href="javascript:history.back(-1);" class="back"><i class="iconfont icon-up"></i><span>返回上一页</span></a>
    <a href="javascript:;"><i class="iconfont icon-home"></i><span>首页</span></a>
    <i class="arrow iconfont icon-arrow-right"></i>
    <span>管理中心</span>
</div>
<!--/导航栏-->
<!--内容-->
<div class="nlist-1">
    <ul>
        <li id="signalUserName"></li>
        <li id="signalTime"></li>
        <li id="signalIp"></li>
    </ul>
</div>
<div class="line10"></div>
<div class="nlist-2">
    <h3><i class="iconfont icon-user"></i>统计信息</h3>
    <ul>
        <li><p>普通会员：@ViewBag.普通会员</p></li>
        <li><p>分销会员：@ViewBag.分销会员</p></li>
        <li><p>未发货订单：@ViewBag.未发货订单</p></li>
        <li><p>未付款订单：@ViewBag.未付款订单</p></li>
        <li><p>商家提现：@ViewBag.商家提现</p></li>
        <li><p>会员提现：@ViewBag.会员提现</p></li>
    </ul>
</div>
<div class="line20"></div>
<div class="nlist-2">
    <ul>
        <div id="container" style="min-width:500px;min-height:400px"></div>
    </ul>
</div>
<div class="line10"></div>
<div class="nlist-1">
    <ul>
        <li>本次登录IP：@ViewBag.litIP</li>
        <li>上次登录IP：@ViewBag.litBackIP</li>
        <li>上次登录时间：@ViewBag.litBackTime</li>
    </ul>
</div>
<!--/内容-->
<script type="text/javascript" src="/Scripts/Highcharts/5.0.6/js/highcharts.js"></script>
<script type="text/javascript" src="/Scripts/Highcharts/5.0.6/js/modules/exporting.js"></script>
<script type="text/javascript">
    $(function () {
        $('#container').highcharts({
            chart: {
                type: 'area'
            },
            title: {
                text: '成交量统计'
            },
            subtitle: {
                text: '7日对照表'
            },
            xAxis: {
                labels: {
                    formatter: function () {
                        return this.value; // clean, unformatted number for year
                    }
                }
            },
            yAxis: {
                title: {
                    text: '成交量对比'
                },
                labels: {
                    formatter: function () {
                        return this.value / 1 + 'CNY';
                    }
                }
            },
            tooltip: {
                pointFormat: '{series.name}  <b>{point.y:,.0f}</b><br/>  {point.x}'
            },
            plotOptions: {
                area: {
                    pointStart: 1,
                    marker: {
                        enabled: false,
                        symbol: 'circle',
                        radius: 2,
                        states: {
                            hover: {
                                enabled: true
                            }
                        }
                    }
                }
            },
            series: [{
                name: '订单',
                data: [10, 30, 50, 20, 35, 10, 80]
            },
            {
                name: '已付',
                data: [8, 16, 30, 19, 30, 2, 70]
            }]
        });
    });
</script>